# -*- coding: utf-8 -*-

'''
Created on 2010/07/15

@author: saburo
'''

from pyrfid.DataProtocol.Driver.DriverInterface import DriverInterface
from abc import abstractmethod
from pyrfid.DataProtocol.Exception.ExecutionCodeException.InterrogatorCommunicationErrorException import InterrogatorCommunicationErrorException
from pyrfid.DataProtocol.Driver.SessionManager import SessionManager

import sys
from pyrfid.DataProtocol.Exception.ExecutionCodeException.ExecutionCodeException import ExecutionCodeException
from pyrfid.DataProtocol.Exception.ExecutionCodeException.InvalidParameterException import InvalidParameterException

class HFDriver(DriverInterface):
    
    __CURRENT_LEVEL = 0
    LEVEL_0 = 0 #controle handler
    LEVEL_1 = 1 #uncontrole handler
    __IS_BLOCK = False
    __session_manager = ""
            
    #Address Information ###########################
    
    ################################################
    
    def __init__(self, is_block, level, life_time):
        pass
    
    @abstractmethod
    def _writeCommand(self, tag_id, memory_type, start_address, write_data):
        pass
    
    @abstractmethod
    def _readCommand(self, tag_id, memory_type, start_address, width):
        pass
    
    @abstractmethod
    def _inventoryCommand(self): 
        pass    
    
    @abstractmethod
    def _selectCommand(self):
        pass    

    
    def getSessionManager(self):
        return self.__session_manager
            
    def _createSession(self, tag_id):
        pass
    
    def writeUserMemory(self, tag_id, start_address, write_data):
        pass
    
    def writeData(self, tag_id, start_address, write_data, write_memory_bank = 3):
        pass
    
    def readUserMemory(self, tag_id, start_address, width):
        pass
    
    def readData(self, tag_id, start_address, width, read_bank_type = 3):        
        pass
        
    def configureAFI(self, tag_id, afi):
        pass

    def getAFI(self, tag_id):  
        pass
        
    def configureDSFID(self, tag_id, dsfid):
        pass
    
    def getDSFID(self, tag_id):        
        pass
    
    def getUserMemoryLength(self, tagId, executeBankType = 3):
        pass